package com.mew.slots.core.common.handler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @Author King.Song
 * @Date 2020/11/22 0022
 **/
@Configuration
public class CacheConfig {

    @Autowired
    private ExpireCacheServer cacheServer;
    @Bean
    public SlotsSessionManager caffeineCache() {
        return new SlotsSessionManager((key, value, cause) -> cacheServer.doRemovalListener(key, value, cause));
    }

}
